package service.impl;

import enums.LogLevel;
import service.Logger;

/**
 * 文件日志记录器 - 具体产品
 */
public class FileLogger implements Logger {
    private String filePath;
    private LogLevel level = LogLevel.INFO;
    
    public FileLogger(String filePath) {
        this.filePath = filePath;
        System.out.println("初始化文件日志记录器，文件路径: " + filePath);
    }
    
    @Override
    public void log(String message) {
        // 模拟写入文件
        System.out.println("[文件日志][" + level + "] " + message);
        System.out.println("消息已写入文件: " + filePath);
    }
    
    @Override
    public void setLevel(LogLevel level) {
        this.level = level;
    }
    
    @Override
    public LogLevel getLevel() {
        return level;
    }
}

